import Vue from "vue"
import VueRouter from "vue-router"
import Layout from "../views/Layout.vue" // 确保路径正确

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "Layout",
    component: Layout, // 使用 Layout 作为父组件
    children: [
      {
        path: "system/post",
        name: "system_post",
        component: () => import("../views/components/system_post.vue"),
      },
      {
        path: "system/dept",
        name: "system_dept",
        component: () => import("../views/components/system_dept.vue"),
      },
      {
        path:"/system/user",
        name:"system_user",
        component:()=>import("../views/components/system_user.vue"),
      }
    ],
  },
  {
    path: "/login",
    name: "login",
    component: () =>
      import(/* webpackChunkName: "login" */ "../views/LoginView.vue"),
  },
]

const router = new VueRouter({
  routes,
})

export default router
///system/dept
